
//获得点播参数
var baseUrl = "http://192.168.2.205:9999/ebjcfsweb/";
var vu, uu, name, readCnt, about;

//获得相关参数
function GetQueryString(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

//生成签名，参数 
var authToken = "QYVD8W2JJW4KYDP2YMKWFX36";
var lessName = GetQueryString("lessId");
var lessId = '{"lessId":"'+lessName+'"}';
var nowDate = new Date();
var sendTime = nowDate.getTime();
var signLess = Crypto.MD5("sendTime="+sendTime+'data={"lessId":"'+lessName+'"}').toUpperCase();
  // 获取vu uu参数
  $.ajax({
    url : baseUrl + 'getLessInfo',
    type : "POST",
    dataType : 'json',
    async : false,
    data :
    {   
        sign : signLess,
        signType : '01',
        data : lessId,
        authToken : "QYVD8W2JJW4KYDP2YMKWFX36",
        sendTime : sendTime,
        appType : '01',
        version : '1.0'
    },
    success : function (res)
    {
        window.sessionStorage.clear();
        var data = res.data;
        var result = JSON.parse(data);
        vu = result.vdoVU;
        uu = result.vdoUU;
        name = result.name;
        readCnt = result.readCnt;
        about = result.about;
        if (res.rspCode == "0000")
        {
            window.sessionStorage.setItem("vu", vu);
            window.sessionStorage.setItem("uu", uu);
            window.sessionStorage.setItem("name", name);
            window.sessionStorage.setItem("readCnt", readCnt);
            window.sessionStorage.setItem("about", about);
            window.sessionStorage.setItem("dataflag", 0);
        } else {
            window.sessionStorage.setItem("dataflag", 1);
        }
    },
    error : function ()
    {
        alert("服务器繁忙，请稍后再试");
    }
  });
 
